<script type="text/javascript" src="/admins/js/jquery/jquery.PrintArea.js"></script>
<div id="xz" style="margin-bottom: 20px;">
    运送方式：<select id="xzys" name="xzys" onchange="javascript:xz()">
        <option value="1">互联易/DHL</option>
        <option value="2">新加坡EMS</option>
        <option value="3">大陆EMS</option>
        <option value="4">香港EMS</option>
        <option value="5">UPS</option>
        <option value="6">香港邮政大包</option>
        <option value="7">顺丰</option>
        <option value="8">ComOne</option>
        <option value="9">中国邮政</option>
    </select>
    <div style="font-size: 16px;color: red;">互联易和DHL是通用的，但是DHL不需要填写运送方式</div>
</div>
    <style>
        body{
            -webkit-print-color-adjust: exact;
        }
        #fs2{
            width:100%;
        }
    </style>
    <div id="fs1" style="display:block;">
        <div style="width: 600px;float: left;margin-right: 10px;" id="addcontent">
          <table width="600" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td colspan="4" align="center" height="60px" style="font-size:20px;font-weight: 900;">打印运送单</td>
            </tr>
            <tr>
              <td align="right" height="36px">数量：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sl" onblur="javascript:prin('sl')" value="<?php echo $this->invoicedetail?count($this->invoicedetail):$this->storedetail?count($this->storedetail):0;?>"></td>
              <td align="right">价格：</td>
              <td>&nbsp;&nbsp;<input type="text" id="jg" onblur="javascript:prin('jg')" value="<?php echo $this->invoice?$this->invoice->total:"";?>"></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td>&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>"></td>
              <td align="right">目的地：</td>
              <td>&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td>&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">运送方式：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="ysfs" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('ysfs')"></textarea></td>
            </tr>
            <tr>
              <td align="right" height="120px">包裹详情：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="bgxq" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('bgxq')"><?php 
                            if($this->invoicedetail != ''){
                                foreach ($this->invoicedetail as $key => $val) { 
                                    echo ($key+1)."、".$val->description."*".$val->num."\n";
                            }}else{
                                if($this->storedetail != ''){
                                foreach ($this->storedetail as $key => $val) { 
                                    echo ($key+1)."、".$val->StoreItem->productName."\n";
                                }}
                            }
                        ?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="dz" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 600px;float: left;font-size: 14px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 14px;
                }
            </style>
        <table width="600px" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="147px" colspan="6">&nbsp;</td>
                </tr>
                <tr>
                    <td width="10px">&nbsp;</td>
                    <td height="20px" colspan="2">&nbsp;</td>
                    <td style="text-align:center;" width="50px;"><div id="sl"><?php echo $this->invoicedetail?count($this->invoicedetail):$this->storedetail?count($this->storedetail):0;?></div></td>
                    <td colspan="2" width="200px;">&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td height="126" colspan="2"  width="310px" valign="top" >
                        <div style="height:30px;">&nbsp;</div>
                        <div id="ysfs" style="margin-left:5px;width: 260px;font-size: 16px;">运送方式</div>
                    </td>
                    <td colspan="3" width="150px" valign="top" >
                        <div style="height:60px;">&nbsp;</div>
                        <div id="bgxq" style="margin-left:5px;font-size:14px;"><?php if($this->invoicedetail != ''){
                                foreach ($this->invoicedetail as $key => $val) { 
                                    echo ($key+1)."、".$val->description."\n";
                            }}else{
                                if($this->storedetail != ''){
                                foreach ($this->storedetail as $key => $val) { 
                                    echo ($key+1)."、".$val->StoreItem->productName."\n";
                                }}
                            }?>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td height="103px" colspan="2" rowspan="3" valign="top" >
                        <div style="height:40px;">&nbsp;</div>
                        <div id="dz" style="margin-left:5px;width: 260px;font-size:14px;"><?php echo $this->billall->conAdd;?></div>
                    </td>
                    <td colspan="3" height="63px">&nbsp;</td>
                </tr>
                <tr>
                    <td height="25px">&nbsp;</td>
                    <td >$<div id="jg" style="text-align: left;float: right;width:40px;"><?php echo $this->invoice?$this->invoice->total:"价格";?></div></td>
                    <td colspan="2" >&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td height="27" colspan="3">&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td  height="40" width="140px"><div style="height:18px;">&nbsp;</div><div id="yb" style="margin-left:10px;font-size: 10px;"><?php echo $this->billall->conPostCode;?></div></td>
                    <td width="140px"><div style="height:18px;">&nbsp;</div><div id="mdd" style="margin-left:5px;font-size: 10px;"><?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?></div></td>
                    <td colspan="3" >&nbsp;</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td height="40"><div style="height:1px;">&nbsp;</div><div id="sjr" style="margin-left:10px;font-size: 10px;"><?php echo $this->billall->consignee;?></div></td>
                    <td ><div style="height:1px;">&nbsp;</div><div id="dh" style="margin-left:10px;font-size: 10px;"><?php echo $this->billall->conTel;?></div></td>
                    <td colspan="3">&nbsp;</td>
                </tr>
          </table>
        </div>
    </div>
    <div id="fs2" style="display:none;">
        <div style="width: 560px;float: left;margin-right: 10px;" id="addcontent">
          <table width="600" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td>&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="dz" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td>&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>"></td>
              <td align="right">目的地：</td>
              <td>&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr height="36px">
                <td align="center" colspan="2">物品信息</td>
                <td align="center" >数量</td>
                <td align="center" >价格</td>
            </tr>
            <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { ?>
                <tr height="36px">
                    <td colspan="2"><input type="text" name="inna<?php echo $key;?>" id="inna<?php echo $key;?>" onblur="javascript:prin('inna<?php echo $key;?>')" value="<?php echo $val->description;?>"/><input type="hidden" id="into<?php echo $key;?>" name="into<?php echo $key;?>" value="<?php echo $val->total;?>"/></td>
                    <td><input type="text" name="insu<?php echo $key;?>" id="insu<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->num;?>"/></td>
                    <td><input type="text" name="inpr<?php echo $key;?>" id="inpr<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->price;?>"/></td>
                </tr>
            <?php }}
            $num = $this->invoicedetail?count($this->invoicedetail):0;
            for ($i = $num; $i < (4-$num+1); $i++) { ?>
                <tr height="36px">
                    <td colspan="2"><input type="text" name="inna<?php echo $i;?>" id="inna<?php echo $i;?>" onblur="javascript:prin('inna<?php echo $i;?>')"/><input type="hidden" id="into<?php echo $i;?>" name="into<?php echo $i;?>" value=""/></td>
                    <td><input type="text" name="insu<?php echo $i;?>" id="insu<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inpr<?php echo $i;?>" id="inpr<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                </tr>
            <?php }?>
            <tr>
              <td align="right" height="36px">总价：</td>
              <td colspan="3">&nbsp;&nbsp;<input type="text" id="zj" onblur="javascript:prin('zj')" value="<?php echo $this->invoice?$this->invoice->total:"";?>"></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 890px;float: left;font-size: 14px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 12px;
                }
            </style>
            <table width="900px" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="70px" colspan="6">&nbsp;</td>
                </tr>
                <tr>
                  <td width="60px" rowspan="9">&nbsp;</td>
                  <td colspan="2" rowspan="4" width="470px">&nbsp;</td>
                  <td width="150px" height="20"><div id="sjr"><?php echo $this->billall->consignee;?></div></td>
                  <td width="50px">&nbsp;</td>
                  <td width="130px"><div id="dh" style="text-align:right;"><?php echo $this->billall->conTel;?></div></td>
                </tr>
                <tr>
                    <td height="40" colspan="3"><div id="dz" style="margin-top:15px;font-size:14px;font-family: Microsoft yahei;"><?php echo $this->billall->conAdd;?></div></td>
                </tr>
                <tr>
                  <td height="20">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td><div id="yb" style="text-align:right;margin-top:5px;"><?php echo $this->billall->conPostCode;?></div></td>
                </tr>
                <tr>
                    <td height="20" colspan="3"><div id="mdd"><?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?></div></td>
                </tr>
                <tr>
                  <td height="95px" colspan="5">&nbsp;</td>
                </tr>
                <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { ?>
                <tr>
                    <td  height="20" width="360px"><div id="inna<?php echo $key;?>" style="margin-left:20px;"><?php echo $val->description;?></div></td>
                    <td ><div id="insu<?php echo $key;?>" style="text-align:center;"><?php echo $val->num;?></div></td>
                    <td align="right"><div id="inpr<?php echo $key;?>" style="margin-right:10px;"><?php echo $val->price;?></div></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
            <?php }}
                $num = $this->invoicedetail?count($this->invoicedetail):1;
                for ($i = $num; $i < (4-$num+1); $i++) {
            ?>
                <tr>
                    <td  height="20" width="360px"><div id="inna<?php echo $i;?>" style="margin-left:20px;"></div></td>
                    <td ><div id="insu<?php echo $i;?>" style="text-align:center;"></div></td>
                    <td align="right"><div id="inpr<?php echo $i;?>" style="margin-right:10px;"></div></td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
            <?php }?>
                <tr>
                  <td height="20">&nbsp;</td>
                  <td><div id="zj"style="text-align:center;"><?php echo $this->invoice?$this->invoice->total:"";?></div></td>
                  <td align="right">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
          </table>
        </div>
    </div>
    <div id="fs3" style="display:none;">
        <div style="width: 520px;float: left;margin-right: 10px;" id="addcontent">
          <table width="600" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td>&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="dz" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td>&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>"></td>
              <td align="right">目的地：</td>
              <td>&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr height="36px">
                <td align="center" colspan="2">物品信息</td>
                <td align="center" >数量</td>
                <td align="center" >价格</td>
            </tr>
            <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { ?>
                <tr height="36px">
                    <td colspan="2"><input type="text" name="inna<?php echo $key;?>" id="inna<?php echo $key;?>" onblur="javascript:prin('inna<?php echo $key;?>')" value="<?php echo $val->description;?>"/><input type="hidden" id="into<?php echo $key;?>" name="into<?php echo $key;?>" value="<?php echo $val->total;?>"/></td>
                    <td><input type="text" name="insu<?php echo $key;?>" id="insu<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->num;?>"/></td>
                    <td><input type="text" name="inpr<?php echo $key;?>" id="inpr<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->price;?>"/></td>
                </tr>
            <?php }}
            $num = $this->invoicedetail?count($this->invoicedetail):0;
            for ($i = $num; $i < (5-$num+1); $i++) { ?>
                <tr height="36px">
                    <td colspan="2"><input type="text" name="inna<?php echo $i;?>" id="inna<?php echo $i;?>" onblur="javascript:prin('inna<?php echo $i;?>')"/><input type="hidden" id="into<?php echo $i;?>" name="into<?php echo $i;?>" value=""/></td>
                    <td><input type="text" name="insu<?php echo $i;?>" id="insu<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inpr<?php echo $i;?>" id="inpr<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                </tr>
            <?php }?>
            <tr>
              <td align="right" height="36px">总价：</td>
              <td colspan="3">&nbsp;&nbsp;<input type="text" id="zj" onblur="javascript:prin('zj')" value="<?php echo $this->invoice?$this->invoice->total:"";?>"></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 940px;float: left;font-size: 12px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 16px;
                }
            </style>
            <table width="940" border="0" cellpadding="0" cellspacing="0" style="font-size:18px;">
                <tr>
                    <td  colspan="6" width="920px" height="30px" >&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="4" rowspan="5" style="width:520px;">&nbsp;</td>
                    <td colspan="2" height="50px" ><div id="sjr" style="margin-left:100px;height: 30px;font-size: 20px;"><?php echo $this->billall->consignee; ?></div></td>
                </tr>
                <tr>
                    <td style="width:230px;">&nbsp;</td>
                    <td style="width:210px;height: 50px;"><div id="mdd" style="margin-left:30px;margin-top: 20px;"><?php echo $this->billall->UserCity->ename . '(' . $this->billall->UserCity->name . ')'; ?></div></td>
                </tr>
                <tr>
                    <td colspan="2" style="height: 50px;">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="2" style="height: 100px;"><div id="dz" style="margin-left:50px;padding: 0 0 10px 0;font-size: 16px;font-family: Microsoft yahei;"><?php echo $this->billall->conAdd; ?></div></td>
                </tr>
                <tr>
                    <td style="height: 50px;"><div id="yb" style="text-align:left;margin-left: 30px;margin-top: 20px;"><?php echo $this->billall->conPostCode;?></div></td>
                    <td><div id="dh" style="text-align:left;margin-left: 30px;margin-top: 20px;"><?php echo $this->billall->conTel; ?></div></td>
                </tr>
                <tr>
                    <td  colspan="6" width="920px" height="150px" >&nbsp;</td>
                </tr>
                <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { ?>
                <tr>
                    <td width="240px"><div id="inna<?php echo $key;?>" style="margin-left: 30px"><?php echo $val->description;?></div></td>
                    <td width="50px"><div id="insu<?php echo $key;?>" style="text-align:center;"><?php echo $val->num;?></div></td>
                    <td width="50px">&nbsp;</td>
                    <td ><div id="inpr<?php echo $key;?>" style="text-align:center;width: 80px;"><?php echo $val->price;?></div></td>
                    <td colspan="2" rowspan="5">&nbsp;</td>
                </tr>
            <?php }}
                $num = $this->invoicedetail?count($this->invoicedetail):0;
                for ($i = $num; $i < (5-$num+1); $i++) {
            ?> 
                <tr>
                    <td width="240px"><div id="inna<?php echo $i;?>" style="margin-left:30px;"></div></td>
                    <td width="50px"><div id="insu<?php echo $i;?>" style="text-align:center;"></div></td>
                    <td width="50px">&nbsp;</td>
                    <td><div id="inpr<?php echo $i;?>" style="text-align:center;width: 80px;"></div></td>
                </tr>
            <?php }?>
                <tr>
                    <td colspan="3">&nbsp;</td>
                    <td ><div id="zj" style="text-align:left;margin-left: 2px;"><?php echo $this->invoice?$this->invoice->total:"";?></div></td>
                </tr>
            </table>
        </div>
    </div>
    <div id="fs4" style="display:none;">
        <div style="width: 520px;float: left;margin-right: 10px;" id="addcontent">
          <table width="500" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td colspan="2" width="150px;">&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" style="width:100px;" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td >&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="4">&nbsp;&nbsp;<textarea id="dz" cols="54" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>" style="width:100px;"></td>
              <td align="right">目的地：</td>
              <td >&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr height="36px">
                <td align="center">物品信息</td>
                <td align="center" >数量</td>
                <td align="center" width="100px">重量(kg)</td>
                <td align="center" >单价</td>
                <td align="center" >总价</td>
            </tr>
            <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { ?>
                <tr height="36px">
                    <td><input type="text" name="inna<?php echo $key;?>" id="inna<?php echo $key;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $key;?>')" value="<?php echo $val->description;?>"/></td>
                    <td><input type="text" name="insu<?php echo $key;?>" id="insu<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->num;?>"/></td>
                    <td><input type="text" name="inwe<?php echo $key;?>" id="inwe<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $key;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $key;?>" id="inpr<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->price;?>"/></td>
                    <td><input type="text" name="into<?php echo $key;?>" id="into<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('into<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->total;?>"/></td>
                </tr>
            <?php }}
            $num = $this->invoicedetail?count($this->invoicedetail):0;
            for ($i = $num; $i < (4-$num+1); $i++) { ?>
                <tr height="36px">
                    <td><input type="text" name="inna<?php echo $i;?>" id="inna<?php echo $i;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $i;?>')"/></td>
                    <td><input type="text" name="insu<?php echo $i;?>" id="insu<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inwe<?php echo $i;?>" id="inwe<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $i;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $i;?>" id="inpr<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="into<?php echo $i;?>" id="into<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('into<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                </tr>
            <?php }?>
            <tr>
              <td align="right" height="36px">总价：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="zj" onblur="javascript:prin('zj')" value="<?php echo $this->invoice?$this->invoice->total:"";?>" style="width:100px;"></td>
              <td align="right">总重：</td>
              <td>&nbsp;&nbsp;<input type="text" id="zz" onblur="javascript:prin('zz')" value=""></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 940px;float: left;font-size: 12px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 16px;
                }
            </style>
            <table width="900px" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="100" colspan="5">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="3" rowspan="2" width="300px">&nbsp;</td>
                    <td height="130" colspan="2" width="600px">
                        <div id="sjr" style="margin-left:100px;height: 30px;font-size: 20px;margin-top: -15px;"><?php echo $this->billall->consignee; ?></div>
                        <div id="dz" style="margin-left:50px;padding: 0 0 10px 0;font-size: 16px;font-family: Microsoft yahei;"><?php echo $this->billall->conAdd; ?></div>
                        <div id="mdd" style="margin-right:30px;margin-top: 10px;text-align: right;"><?php echo $this->billall->UserCity->ename . '(' . $this->billall->UserCity->name . ')'; ?></div>
                    </td>
                </tr>
                <tr>
                    <td width="300px" height="45px"><div id="yb" style="text-align:right;margin-right: 30px;font-size: 14px;;"><?php echo $this->billall->conPostCode; ?></div></td>
                    <td width="300px" ><div id="dh" style="text-align:right;margin-right: 30px;font-size: 14px;"><?php echo $this->billall->conTel; ?></div></td>
                </tr>
                <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { ?>
                <tr>
                    <td width="300" height="25px">
                        <div id="inna<?php echo $key;?>" style="margin-left: 35px;float:left;"><?php echo $val->description;?></div><div id="insu<?php echo $key;?>" style="text-align:left;float:left;margin-left: 5px;"><?php echo $val->num;?></div></td>
                    <td width="50"><div id="inwe<?php echo $key;?>" style="text-align:center;width: 80px;"></div></td>
                    <td width="50"><div id="into<?php echo $key;?>" style="text-align:center;width: 80px;"><?php echo $val->total;?></div></td>
                    <?php if($key == 0){?><td colspan="2" rowspan="5">&nbsp;</td><?php }?>
                </tr>
            <?php }}
                $num = $this->invoicedetail?count($this->invoicedetail):1;
                for ($i = $num; $i < (4-$num+1); $i++) {
            ?> 
                <tr>
                    <td height="25px"><div id="inna<?php echo $i;?>" style="margin-left: 35px;float:left;"></div><div id="insu<?php echo $i;?>" style="text-align:left;float:left;margin-left: 5px;"></div></td>
                    <td><div id="inwe<?php echo $i;?>" style="text-align:center;width: 80px;"></div></td>
                    <td><div id="into<?php echo $i;?>" style="text-align:center;width: 80px;"></div></td>
                </tr>
            <?php }?>
                <tr>
                    <td height="30px" colspan="3"></td>
                </tr>
                <tr>
                    <td height="20px"></td>
                    <td><div id="zz" style="text-align:center;"></div></td>
                    <td><div id="zj" style="text-align:center;"><?php echo $this->invoice?$this->invoice->total:"";?></div></td>
                </tr>
            </table>
        </div>
    </div>
    <div id="fs5" style="display:none;">
        <div style="width: 600px;float: left;margin-right: 10px;" id="addcontent">
          <table width="600" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td colspan="4" align="center" height="60px" style="font-size:20px;font-weight: 900;">打印运送单</td>
            </tr>
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td>&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="dz" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td>&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>"></td>
              <td align="right">目的地：</td>
              <td>&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 600px;float: left;font-size: 14px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 14px;
                }
            </style>
            <table width="350" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="155px" colspan="4">&nbsp;</td>
                </tr>
                <tr>
                    <td height="36" colspan="2"><div id="sjr" style="text-align:center;height: 20px;font-size: 12px;margin-top: 10px;"><?php echo $this->billall->consignee; ?></div></td>
                    <td colspan="2"><div id="dh" style="text-align:center;font-size: 12px;margin-top: 10px;"><?php echo $this->billall->conTel; ?></div></td>
                </tr>
                <tr>
                    <td height="70px" colspan="4"><div id="dz" style="width: 320px;margin-left:20px;padding: 0 0 10px 0;font-size: 16px;font-family: Microsoft yahei;"><?php echo $this->billall->conAdd; ?></div></td>
                </tr>
                <tr>
                    <td width="50" height="24">&nbsp;</td>
                    <td width="91"><div id="yb" style="text-align:right;margin-right: 30px;font-size: 12px;;"><?php echo $this->billall->conPostCode; ?></div></td>
                    <td width="50">&nbsp;</td>
                    <td><div id="mdd" style="margin-left:10px;font-size: 12px;"><?php echo $this->billall->UserCity->ename . '(' . $this->billall->UserCity->name . ')'; ?></div></td>
                </tr>
            </table>
        </div>
    </div>
    <div id="fs6" style="display:none;">
        <div style="width: 520px;float: left;margin-right: 10px;" id="addcontent">
          <table width="500" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td colspan="2" width="150px;">&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" style="width:100px;" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td >&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="4">&nbsp;&nbsp;<textarea id="dz" cols="54" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>" style="width:100px;"></td>
              <td align="right">目的地：</td>
              <td >&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr height="36px">
                <td align="center">物品信息</td>
                <td align="center" >数量</td>
                <td align="center" width="100px">重量(kg)</td>
                <td align="center" >单价</td>
                <td align="center" >HS number</td>
            </tr>
            <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { 
                            if($key == 3){break;}
             ?>
                <tr height="36px">
                    <td><input type="text" name="inna<?php echo $key;?>" id="inna<?php echo $key;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $key;?>')" value="<?php echo $val->description;?>"/></td>
                    <td><input type="text" name="insu<?php echo $key;?>" id="insu<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->num;?>"/></td>
                    <td><input type="text" name="inwe<?php echo $key;?>" id="inwe<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $key;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $key;?>" id="inpr<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->price;?>"/></td>
                    <td><input type="text" name="inhs<?php echo $key;?>" id="inhs<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inhs<?php echo $key;?>')" /></td>
                </tr>
            <?php }}
            $num = $this->invoicedetail?count($this->invoicedetail):0;
            for ($i = $num; $i < 4-($num+1); $i++) { ?>
                <tr height="36px"><input type="hidden" id="into<?php echo $i;?>" name="into<?php echo $i;?>" value/>
                    <td><input type="text" name="inna<?php echo $i;?>" id="inna<?php echo $i;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $i;?>')"/></td>
                    <td><input type="text" name="insu<?php echo $i;?>" id="insu<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inwe<?php echo $i;?>" id="inwe<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $i;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $i;?>" id="inpr<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inhs<?php echo $i;?>" id="inhs<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inhs<?php echo $i;?>')" /></td>
                </tr>
            <?php }?>
            <tr>
              <td align="right" height="36px">总价：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="zj" onblur="javascript:prin('zj')" value="<?php echo $this->invoice?$this->invoice->total:"";?>" style="width:100px;"></td>
              <td align="right">总重：</td>
              <td>&nbsp;&nbsp;<input type="text" id="zz" onblur="javascript:prin('zz')" value=""></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 940px;float: left;font-size: 12px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 14px;
                }
            </style>
            <table width="600" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="30" rowspan="9">&nbsp;</td>
                    <td height="120" colspan="6">&nbsp;</td>
                </tr>
                <tr>
                    <td height="50" colspan="4"><div id="sjr" style="margin-left:50px;height: 20px;font-size: 16px;"><?php echo $this->billall->consignee; ?></div>
                        <div id="dz" style="margin-left:20px;padding: 0 0 10px 0;font-size: 12px;font-family: Microsoft yahei;height:30px"><?php echo $this->billall->conAdd; ?></div></td>
                    <td width="117" colspan="2" rowspan="2">&nbsp;</td>
                </tr>
                <tr>
                    <td width="60" height="24">&nbsp;</td>
                    <td width="180"><div id="mdd" style="text-align: left;font-size: 12px;"><?php echo $this->billall->UserCity->ename . '(' . $this->billall->UserCity->name . ')'; ?></div></td>
                    <td colspan="2"><div id="yb" style="text-align:right;margin-right: 30px;font-size: 14px;"><?php echo $this->billall->conPostCode; ?></div></td>
                </tr>
                <tr>
                    <td colspan="6" height="12"></td>
                </tr>
                <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { 
                            if($key == 3){break;}
                ?>
                <tr>
                    <td colspan="2" height="16"><div id="inna<?php echo $key;?>" style="margin-left: 25px;float:left;font-size: 12px;"><?php echo $val->description;?></div></td>
                    <td width="60"><div id="inwe<?php echo $key;?>" style="text-align:center;font-size: 12px;">&nbsp;</div></td>
                    <td width="50"><div id="inpr<?php echo $key;?>" style="text-align:center;font-size: 12px;"><?php echo $val->price;?></div></td>
                    <td width="50"><div id="insu<?php echo $key;?>" style="text-align:center;float:left;margin-left: 5px;font-size: 12px;width: 50px;"><?php echo $val->num;?></div></td>
                    <td><div id="inhs<?php echo $key;?>" style="text-align:left;float:left;margin-left: 15px;font-size: 12px;">&nbsp;</div></td>
                </tr>
            <?php }}
                $num = $this->invoicedetail?count($this->invoicedetail):1;
                for ($i = $num; $i < (4-$num+1); $i++) {
            ?> 
                <tr>
                    <td colspan="2" height="16"><div id="inna<?php echo $i;?>" style="margin-left: 25px;float:left;font-size: 12px;">&nbsp;</div></td>
                    <td width="60"><div id="inwe<?php echo $i;?>" style="text-align:center;font-size: 12px;">&nbsp;</div></td>
                    <td width="50"><div id="inpr<?php echo $i;?>" style="text-align:center;font-size: 12px;">&nbsp;</div></td>
                    <td width="50"><div id="insu<?php echo $i;?>" style="text-align:center;float:left;margin-left: 5px;font-size: 12px;width: 50px;">&nbsp;</div></td>
                    <td><div id="inhs<?php echo $i;?>" style="text-align:left;float:left;margin-left: 15px;font-size: 12px;">&nbsp;</div></td>
                </tr>
            <?php }?>
                <tr>
                    <td colspan="6" height="12"></td>
                </tr>
                <tr>
                    <td colspan="2" height="24" align="center"><div style="float:left;margin-left: 25px;">Tel：</div><div id="dh" style="text-align:left;float:left;"><?php echo $this->billall->conTel; ?></div></td>
                    <td><div id="zz" style="text-align:center;">&nbsp;</div></td>
                    <td><div id="zj" style="text-align:center;"><?php echo $this->invoice?$this->invoice->total:"";?></div></td>
                    <td colspan="2">&nbsp;</td>
                </tr>
            </table>
        </div>
    </div>
    <div id="fs7" style="display:none;">
        <div style="width: 600px;float: left;margin-right: 10px;" id="addcontent">
          <table width="600" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td colspan="4" align="center" height="60px" style="font-size:20px;font-weight: 900;">打印运送单</td>
            </tr>
             <tr>
              <td align="right" height="36px">收件人：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td>&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td>&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>"></td>
              <td align="right" height="36px">数量：</td>
              <td>&nbsp;&nbsp;<input type="text" id="sl" onblur="javascript:prin('sl')" value="<?php echo $this->invoicedetail?count($this->invoicedetail):$this->storedetail?count($this->storedetail):0;?>"></td>
            </tr>
           
            <tr>
              <td align="right" height="120px">包裹详情：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="bgxq" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('bgxq')"><?php if($this->storedetail != ''){
                            foreach ($this->storedetail as $key => $val) { 
                                echo ($key+1)."、".$val->StoreItem->productName."\n";
                            }}else{
                            if($this->invoicedetail != ''){
                                foreach ($this->invoicedetail as $key => $val) { 
                                    echo ($key+1)."、".$val->description."\n";
                            }}}
                        ?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="3">&nbsp;&nbsp;<textarea id="dz" cols="64" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="width: 600px;float: left;font-size: 14px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 14px;
                }
            </style>
            <table width="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td height="70" colspan="6">&nbsp;</td>
                </tr>
                <tr>
                  <td height="38" colspan="5">&nbsp;</td>
                  <td height="38">&nbsp;&nbsp;悠奇</td>
                </tr>
                <tr>
                  <td height="48">&nbsp;</td>
                  <td height="48" colspan="6">&nbsp;&nbsp;广东省深圳市宝安区石岩街道塘头大道石岩山城物流园2栋2楼悠奇仓库</td>
                </tr>
                <tr>
                  <td height="32" colspan="3">&nbsp;</td>
                  <td height="32" colspan="3">88605979</td>
                </tr>
                <tr>
                  <td height="45" colspan="6">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="5" height="24">&nbsp;</td>
                    <td width="80"><div id="sjr" style="font-size: 10px;"><?php echo $this->billall->consignee; ?></div></td>
                </tr>
                <tr>
                    <td width="25" height="48">&nbsp;</td>
                    <td colspan="5"><div id="dz" style="font-size:14px;margin-top:5px;height: 48px;"><?php echo $this->billall->conAdd; ?></div></td>
                </tr>
                <tr>
                    <td colspan="3" width="30px">&nbsp;</td>
                    <td colspan="3" height="24" width="200px"><div id="dh" ><?php echo $this->billall->conTel; ?></div></td>
                </tr>
                <tr>
                    <td height="30" colspan="6">&nbsp;</td>
                </tr>
                <tr>
                    <td colspan="5" height="24"><div id="bgxq" style="margin-left:5px;font-size:12px;">
                            <?php
                            if($this->storedetail != ''){
                            foreach ($this->storedetail as $key => $val) { 
                                echo ($key+1)."、".$val->StoreItem->productName."\n";
                            }}else{
                            if($this->invoicedetail != ''){
                                foreach ($this->invoicedetail as $key => $val) { 
                                    echo ($key+1)."、".$val->description."*".$val->num."\n";
                            }}}
                            ?>
                        </div></td>
                    <td><div id="sl" width="50px" style="text-align:center;"><?php echo $this->invoicedetail?count($this->invoicedetail):$this->storedetail?count($this->storedetail):0;?></div></td>
                </tr>
            </table>
        </div>
    </div>
    <div id="fs8" style="display:none;">
        <div style="width: 700px;float: left;margin-right: 10px;" id="addcontent">
          <table width="500" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td colspan="2" width="150px;">&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" style="width:100px;" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td >&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="4">&nbsp;&nbsp;<textarea id="dz" cols="54" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>" style="width:100px;"></td>
              <td align="right">目的地：</td>
              <td >&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr>
              <td align="right" height="36px">帐号：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="accountNo" onblur="javascript:prin('accountNo')" value="310200" style="width:100px;"></td>
              <td align="right">发件人：</td>
              <td >&nbsp;&nbsp;<input type="text" id="fjr" onblur="javascript:prin('fjr')" value="卢娜"></td>
            </tr>
            <tr height="36px">
                <td align="center">物品信息</td>
                <td align="center" >数量</td>
                <td align="center" width="100px">重量(kg)</td>
                <td align="center" >单价</td>
                <td align="center" >HS number</td>
            </tr>
            <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { 
                            if($key == 4){break;}
             ?>
                <tr height="36px">
                    <td><input type="text" name="inna<?php echo $key;?>" id="inna<?php echo $key;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $key;?>')" value="<?php echo $val->description;?>"/></td>
                    <td><input type="text" name="insu<?php echo $key;?>" id="insu<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->num;?>"/></td>
                    <td><input type="text" name="inwe<?php echo $key;?>" id="inwe<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $key;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $key;?>" id="inpr<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->price;?>"/></td>
                    <td><input type="text" name="inhs<?php echo $key;?>" id="inhs<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inhs<?php echo $key;?>')" /></td>
                </tr>
            <?php }}
            $num = $this->invoicedetail?count($this->invoicedetail):0;
            for ($i = $num; $i < 3; $i++) { ?>
                <tr height="36px"><input type="hidden" id="into<?php echo $i;?>" name="into<?php echo $i;?>" value/>
                    <td><input type="text" name="inna<?php echo $i;?>" id="inna<?php echo $i;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $i;?>')"/></td>
                    <td><input type="text" name="insu<?php echo $i;?>" id="insu<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inwe<?php echo $i;?>" id="inwe<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $i;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $i;?>" id="inpr<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inhs<?php echo $i;?>" id="inhs<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inhs<?php echo $i;?>')" /></td>
                </tr>
            <?php }?>
            <tr>
              <td align="right" height="36px">总价：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="zj" onblur="javascript:prin('zj')" value="<?php echo $this->invoice?$this->invoice->total:"";?>" style="width:100px;"></td>
              <td align="right">总重：</td>
              <td>&nbsp;&nbsp;<input type="text" id="zz" onblur="javascript:prin('zz')" value=""></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="float: left;font-size: 14px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 14px;
                }
				.f9tab{ width:690px; height:405px;}
				.f9tabw{ padding:0 30px 0 15px; }
				.f9tabw .f9tabw1{ width:48%; float:left; padding-right:2%; }
            </style>
            <div class="f9tab">
            	<div style=" width:100%; height:40px;">&nbsp;</div>
            	<div style="height:16px; padding-left:350px;">310200</div>
            	<div style=" width:100%; height:66px;">&nbsp;</div>
                <div class="f9tabw" style="height:59px;">
                    <div class="f9tabw1">广东省深圳市广东省深圳市宝安区石岩街道塘头大道石岩山城物流园2栋2楼悠奇仓库<br/>电话:+86-0755-88605979</div>
                    <div class="f9tabw1"><?php echo $this->billall->conAdd ?></div>
                </div>
                <div class="f9tabw" style="height:16px;"></div>
                
                <div class="f9tabw" style="height:16px;">
                    <div class="f9tabw1" ><span style="padding-left:55px;">卢娜</span></div>
                    <div class="f9tabw1">
                    	<span style=" float:left;padding-left:75px;"><?php echo $this->billall->conPostCode;?></span><span style=" float:right; padding-right:5px;"><?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?></span>
                    </div>
                </div>
                
                <div class="f9tabw" style="height:16px;">
                    <div class="f9tabw1" ><span style="padding-left:230px;"><?php echo date("Y-m-d");?></span></div>
                    <div class="f9tabw1">
                    	<span style=" float:left;padding-left:75px;"><?php echo $this->billall->consignee; ?></span><span style=" float:right; padding-right:5px;"><?php echo $this->billall->conTel;?></span>
                    </div>
                </div>
                <div class="f9tabw" style="height:16px;"></div>
                <div style="height:50px;">
                <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { 
                            if($key == 3){break;}
                            if($key == 0){
                ?>
                    			<div style=" width:210px; height:16px"><?php echo $val->description;?></div>
                            <?php } else if ($key == 1) { ?>
                    			<div style=" width:210px; height:16px"><?php echo $val->description;?></div>
                            <?php } else if ($key == 2) { ?>
                    			<div style=" width:255px; height:16px"><?php echo $val->description;?></div>
                            <?php  } }
                             $num = $this->invoicedetail?count($this->invoicedetail):0;
                            for ($i = $num; $i < 3; $i++) { 
                                if($i == 0){
                                ?>
                                <?php } else if ($i == 1) { ?>
								<div id="amount" style="display:none"><?php echo $this->billall->getFeeByType(Application_Model_FeeType::RatePremiumFee)>0?$this->billall->getFeeByType(Application_Model_FeeType::RatePremiumFee):"";?></div>
                                <?php } else if ($i == 2) { ?>
                            <?php } } } ?>
                 </div>           
                <div class="f9tabw" style="height:16px;"></div>
                <div class="f9tabw" style="height:24px; padding:3px 30px;">$<?php echo $this->invoice?$this->invoice->total:0;?></div>
                
            </div>
        </div>
    </div>
    
    <div id="fs9" style="display:none;">
        <div style="width: 700px;float: left;margin-right: 10px;" id="addcontent">
          <table width="500" border="1" cellpadding="0" cellspacing="0">
            <tr>
              <td align="right" height="36px">收件人：</td>
              <td colspan="2" width="150px;">&nbsp;&nbsp;<input type="text" id="sjr" onblur="javascript:prin('sjr')" style="width:100px;" value="<?php echo $this->billall->consignee;?>"></td>
              <td align="right">电话：</td>
              <td >&nbsp;&nbsp;<input type="text" id="dh" onblur="javascript:prin('dh')" value="<?php echo $this->billall->conTel;?>"></td>
            </tr>
            <tr>
              <td align="right" height="120px">地址：</td>
              <td colspan="4">&nbsp;&nbsp;<textarea id="dz" cols="54" rows="6" style="resize:none;" onblur="javascript:prin('dz')"><?php echo $this->billall->conAdd;?></textarea></td>
            </tr>
            <tr>
              <td align="right" height="36px">邮编：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="yb" onblur="javascript:prin('yb')" value="<?php echo $this->billall->conPostCode;?>" style="width:100px;"></td>
              <td align="right">目的地：</td>
              <td >&nbsp;&nbsp;<input type="text" id="mdd" onblur="javascript:prin('mdd')" value="<?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?>"></td>
            </tr>
            <tr>
              <td align="right" height="36px">帐号：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="accountNo" onblur="javascript:prin('accountNo')" value="310200" style="width:100px;"></td>
              <td align="right">发件人：</td>
              <td >&nbsp;&nbsp;<input type="text" id="fjr" onblur="javascript:prin('fjr')" value="卢娜"></td>
            </tr>
            <tr height="36px">
                <td align="center">物品信息</td>
                <td align="center" >数量</td>
                <td align="center" width="100px">重量(kg)</td>
                <td align="center" >单价</td>
                <td align="center" >HS number</td>
            </tr>
            <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { 
                            if($key == 4){break;}
             ?>
                <tr height="36px">
                    <td><input type="text" name="inna<?php echo $key;?>" id="inna<?php echo $key;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $key;?>')" value="<?php echo $val->description;?>"/></td>
                    <td><input type="text" name="insu<?php echo $key;?>" id="insu<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->num;?>"/></td>
                    <td><input type="text" name="inwe<?php echo $key;?>" id="inwe<?php echo $key;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $key;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $key;?>" id="inpr<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $key;?>')" onchange="javascript:ckprto(<?php echo $key;?>)" value="<?php echo $val->price;?>"/></td>
                    <td><input type="text" name="inhs<?php echo $key;?>" id="inhs<?php echo $key;?>" style="width:70px;" onblur="javascript:prin('inhs<?php echo $key;?>')" /></td>
                </tr>
            <?php }}
            $num = $this->invoicedetail?count($this->invoicedetail):0;
            for ($i = $num; $i < 3; $i++) { ?>
                <tr height="36px"><input type="hidden" id="into<?php echo $i;?>" name="into<?php echo $i;?>" value/>
                    <td><input type="text" name="inna<?php echo $i;?>" id="inna<?php echo $i;?>" style="width:100px;" onblur="javascript:prin('inna<?php echo $i;?>')"/></td>
                    <td><input type="text" name="insu<?php echo $i;?>" id="insu<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('insu<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inwe<?php echo $i;?>" id="inwe<?php echo $i;?>" style="width:30px;" onblur="javascript:prin('inwe<?php echo $i;?>')" onchange="javascript:ckwe()"/></td>
                    <td><input type="text" name="inpr<?php echo $i;?>" id="inpr<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inpr<?php echo $i;?>')" onchange="javascript:ckprto(<?php echo $i;?>)"/></td>
                    <td><input type="text" name="inhs<?php echo $i;?>" id="inhs<?php echo $i;?>" style="width:70px;" onblur="javascript:prin('inhs<?php echo $i;?>')" /></td>
                </tr>
            <?php }?>
            <tr>
              <td align="right" height="36px">总价：</td>
              <td colspan="2">&nbsp;&nbsp;<input type="text" id="zj" onblur="javascript:prin('zj')" value="<?php echo $this->invoice?$this->invoice->total:"";?>" style="width:100px;"></td>
              <td align="right">总重：</td>
              <td>&nbsp;&nbsp;<input type="text" id="zz" onblur="javascript:prin('zz')" value=""></td>
            </tr>
        </table>
        </div>
        <div id="printadd" style="float: left;font-size: 12px;">
            <style>
                body{
                    -webkit-print-color-adjust: exact;
                    font-size: 12px;
                }
            </style>
            <table width="700" height="545" border="0" cellspacing="0" align="right" >
              <tr>
                <td height="75" colspan="4">&nbsp;</td>
              </tr>
              <tr>
    			<td style=" height:18px;padding:20px 0 0 325px;" colspan="4" align="left"><div style="padding-left:145px;">$<?php echo $this->invoice?$this->invoice->total:0;?></div></td>
              </tr>
              
              
              <tr>
                <td width="185" height="20"></td>
                <td width="140"></td>
                <td width="185" align="right"><?php echo $this->billall->consignee; ?>&nbsp;&nbsp;&nbsp;</td>
                <td width="145" align="right" style="font-size:12px;"><?php echo $this->billall->UserCity->ename.'('.$this->billall->UserCity->name.')';?></td>
              </tr>
              <tr>
                <td height="20"></td>
                <td></td>
                <td></td>
                <td align="right"><?php echo $this->billall->UserCity->name ?></td>
              </tr>
              <tr>
                <td colspan="2" height="20"></td>
                <td colspan="2"></td>
              </tr>
              <tr>
                <td colspan="2" height="40" align="right" style="padding-left:66px;"></td>
                <td colspan="2" height="40" align="right" style="padding-left:66px;"><?php echo $this->billall->conAdd ?></td>
              </tr>
              <tr>
                <td width="215" height="20"></td>
                <td width="110"></td>
                <td width="200" align="right"><?php echo $this->billall->conTel; ?></td>
                <td width="120" align="right"><?php echo $this->billall->conPostCode; ?></td>
              </tr>
              <tr>
                <td height="35">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
                <td colspan="4" align="left" cellspacing="0" height="60">
               		<table border="0" cellspacing="0" align="left" height="60">
                <?php if($this->invoicedetail != ''){
                        foreach ($this->invoicedetail as $key => $val) { 
                            if($key == 3){break;}
                            if($key == 0){
                ?>
                  <tr>
                  	<td width="212" align="left" height="20"><?php echo $val->description;?></td><td width="74" align="left" height="20"><?php echo $val->num;?></td><td width="74" align="left" height="20"></td><td width="76" align="left" height="20"><?php echo $val->price;?></td>
                 </tr>
                            <?php } else if ($key == 1) { ?>
                  <tr>
                  	<td width="212" align="left" height="20"><?php echo $val->description;?></td><td width="74" align="left" height="20"><?php echo $val->num;?></td><td width="74" align="left" height="20"></td><td width="76" align="left" height="20"><?php echo $val->price;?></td>
                  </tr>
                            <?php } else if ($key == 2) { ?>
                  <tr>
                  	<td width="212" align="left" height="20"><?php echo $val->description;?></td><td width="74" align="left" height="20"><?php echo $val->num;?></td><td width="74" align="left" height="20"></td><td width="76" align="left" height="20"><?php echo $val->price;?></td>
                  </tr>
                            <?php  } }
                             $num = $this->invoicedetail?count($this->invoicedetail):0;
                            for ($i = $num; $i < 3; $i++) { 
                                if($i == 0){
                                ?>
                                <?php } else if ($i == 1) { ?>
                                <?php } else if ($i == 2) { ?>
                            <?php } } } ?>                    
                    </table> 
                
                </td>
              
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
            </table>
        </div>
    </div>
    
<div style='padding-top:10px;padding-bottom: 5px;padding-left: 20px;float: left;width: 90%' id="div_button">
        <input type="button" id="refo" naem="refo" value="返回" style="background-color: #1668A4;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;"/>
        <input type="button" id="print" naem="print" value="打印" style="background-color: #FF8312;width: 80px;height: 30px;color: white;font-size: 14px;border-radius:8px;margin-left: 250px;"/>
    </div>
<script type="text/javascript">
    $("#refo").click(function(){
        location.href = "/admini/managewaybill/billaccep/id/<?php echo $this->billall->id;?>"; 
    });
    $('#div_button #print').click(function(){
        var fs = $('#xzys').val();
         $.ajax({    
                type: 'POST',
                url: '/admini/managewaybill/isaddbill/id/<?php echo $this->billall->id;?>',
                success: function(data) {
                    if(data == 2){
                        $("#fs"+fs+" div#printadd").printArea(); 
                    }else{
                        alert("发生未知错误，请重新操作");
                        location.href = "/admini/managewaybill/addbill/id/<?php echo $this->billall->id;?>";
                    }
                }
         });
    });
    function prin(name){
        var fs = $('#xzys').val();
        var val = $("#fs"+fs+" input#"+name).val();
        if(name == "ysfs" || name == "bgxq" || name == "dz"){
            val = $('#fs'+fs+' #addcontent #'+name).val();
        }
        $('#fs'+fs+' #printadd div#'+name).text(val);
    } 
    function ckprto(id){
        var fs = $('#xzys').val();
        var sum = $("#fs"+fs+" input#insu"+id).val();
        var price = $("#fs"+fs+" input#inpr"+id).val();
        var total = accMul(sum,price);
        total = total==0?"":total;
        $("#fs"+fs+" input#into"+id).val(total);
        var ztotal = 0;
        var j = fs==3?4:3;   
        for(var i=0;i<j;i++){
            ztotal = accAdd(ztotal,$("#fs"+fs+" input#into"+i).val());
        }
        $("#fs"+fs+" input#zj").val(ztotal);
        $('#fs'+fs+' #printadd div#zj').text(ztotal);
    }
    function ckwe(){
        var fs = $('#xzys').val();
        var zz = 0;
        for(var i=0;i<3;i++){
            zz = accAdd(zz,$("#fs"+fs+" input#inwe"+i).val());
        }
        $("#fs"+fs+" input#zz").val(zz);
        $('#fs'+fs+' #printadd div#zz').text(zz);
    }
    function xz()
    {
        $('#fs1').attr("style", "display:none");
        $('#fs2').attr("style", "display:none");
        $('#fs3').attr("style", "display:none");
        $('#fs4').attr("style", "display:none");
        $('#fs5').attr("style", "display:none");
        $('#fs6').attr("style", "display:none");
        $('#fs7').attr("style", "display:none");
        $('#fs8').attr("style", "display:none");
        $('#fs9').attr("style", "display:none");
        var val = $('#xzys').val();
        $('#fs'+val).attr("style", "display:block");
    }
    function accAdd(arg1, arg2) {
        var r1, r2, m, c;
        try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
        try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
        c = Math.abs(r1 - r2);
        m = Math.pow(10, Math.max(r1, r2))
        if (c > 0) {
            var cm = Math.pow(10, c);
            if (r1 > r2) {
                arg1 = Number(arg1.toString().replace(".", ""));
                arg2 = Number(arg2.toString().replace(".", "")) * cm;
            }
            else {
                arg1 = Number(arg1.toString().replace(".", "")) * cm;
                arg2 = Number(arg2.toString().replace(".", ""));
            }
        }
        else {
            arg1 = Number(arg1.toString().replace(".", ""));
            arg2 = Number(arg2.toString().replace(".", ""));
        }
        return (arg1 + arg2) / m
    }
    function accMul(arg1, arg2) {
        var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
        try { m += s1.split(".")[1].length } catch (e) { }
        try { m += s2.split(".")[1].length } catch (e) { }
        return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
    }
</script>